<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>profiled_run</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Module&nbsp;profiled_run
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="profiled_run-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="profiled_run-module.html">Module profiled_run</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-comment">#!/usr/bin/python</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#coding: utf-8</tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">os</tt><tt class="py-op">,</tt> <tt class="py-name">sys</tt><tt class="py-op">,</tt> <tt class="py-name">random</tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">pygame</tt> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Module dbmanager=dbmanager-module.html"><a title="dbmanager" class="py-name" href="#" onclick="return doclink('link-0', 'dbmanager', 'link-0');">dbmanager</a></tt> <tt class="py-keyword">import</tt> <tt id="link-1" class="py-name" targets="Class dbmanager.DBManager=dbmanager.DBManager-class.html"><a title="dbmanager.DBManager" class="py-name" href="#" onclick="return doclink('link-1', 'DBManager', 'link-1');">DBManager</a></tt> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-2" class="py-name" targets="Module gfxmanager=gfxmanager-module.html"><a title="gfxmanager" class="py-name" href="#" onclick="return doclink('link-2', 'gfxmanager', 'link-2');">gfxmanager</a></tt> <tt class="py-keyword">import</tt> <tt id="link-3" class="py-name" targets="Class gfxmanager.GfxManager=gfxmanager.GfxManager-class.html"><a title="gfxmanager.GfxManager" class="py-name" href="#" onclick="return doclink('link-3', 'GfxManager', 'link-3');">GfxManager</a></tt> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-4" class="py-name" targets="Module stagemanager=stagemanager-module.html"><a title="stagemanager" class="py-name" href="#" onclick="return doclink('link-4', 'stagemanager', 'link-4');">stagemanager</a></tt> <tt class="py-keyword">import</tt> <tt id="link-5" class="py-name" targets="Class stagemanager.StageManager=stagemanager.StageManager-class.html"><a title="stagemanager.StageManager" class="py-name" href="#" onclick="return doclink('link-5', 'StageManager', 'link-5');">StageManager</a></tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-6" class="py-name" targets="Module groupmanager=groupmanager-module.html"><a title="groupmanager" class="py-name" href="#" onclick="return doclink('link-6', 'groupmanager', 'link-6');">groupmanager</a></tt> <tt class="py-keyword">import</tt> <tt id="link-7" class="py-name" targets="Class groupmanager.GroupManager=groupmanager.GroupManager-class.html"><a title="groupmanager.GroupManager" class="py-name" href="#" onclick="return doclink('link-7', 'GroupManager', 'link-7');">GroupManager</a></tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-8" class="py-name" targets="Module spaceship=spaceship-module.html"><a title="spaceship" class="py-name" href="#" onclick="return doclink('link-8', 'spaceship', 'link-8');">spaceship</a></tt> <tt class="py-keyword">import</tt> <tt id="link-9" class="py-name" targets="Class spaceship.PlayerShip=spaceship.PlayerShip-class.html"><a title="spaceship.PlayerShip" class="py-name" href="#" onclick="return doclink('link-9', 'PlayerShip', 'link-9');">PlayerShip</a></tt><tt class="py-op">,</tt> <tt class="py-name">AdvancedPlayerShip</tt><tt class="py-op">,</tt> <tt id="link-10" class="py-name" targets="Class spaceship.EnemyShip=spaceship.EnemyShip-class.html"><a title="spaceship.EnemyShip" class="py-name" href="#" onclick="return doclink('link-10', 'EnemyShip', 'link-10');">EnemyShip</a></tt><tt class="py-op">,</tt> \ </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line">    <tt id="link-11" class="py-name" targets="Class spaceship.EnemyInterceptor=spaceship.EnemyInterceptor-class.html"><a title="spaceship.EnemyInterceptor" class="py-name" href="#" onclick="return doclink('link-11', 'EnemyInterceptor', 'link-11');">EnemyInterceptor</a></tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-12" class="py-name" targets="Module background=background-module.html"><a title="background" class="py-name" href="#" onclick="return doclink('link-12', 'background', 'link-12');">background</a></tt> <tt class="py-keyword">import</tt> <tt id="link-13" class="py-name" targets="Class background.SpaceBackground=background.SpaceBackground-class.html"><a title="background.SpaceBackground" class="py-name" href="#" onclick="return doclink('link-13', 'SpaceBackground', 'link-13');">SpaceBackground</a></tt><tt class="py-op">,</tt> <tt id="link-14" class="py-name" targets="Class background.BackgroundImage=background.BackgroundImage-class.html"><a title="background.BackgroundImage" class="py-name" href="#" onclick="return doclink('link-14', 'BackgroundImage', 'link-14');">BackgroundImage</a></tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-15" class="py-name" targets="Module obstacle=obstacle-module.html"><a title="obstacle" class="py-name" href="#" onclick="return doclink('link-15', 'obstacle', 'link-15');">obstacle</a></tt> <tt class="py-keyword">import</tt> <tt id="link-16" class="py-name" targets="Class obstacle.Obstacle=obstacle.Obstacle-class.html"><a title="obstacle.Obstacle" class="py-name" href="#" onclick="return doclink('link-16', 'Obstacle', 'link-16');">Obstacle</a></tt><tt class="py-op">,</tt> <tt id="link-17" class="py-name" targets="Class obstacle.MovingObstacle=obstacle.MovingObstacle-class.html"><a title="obstacle.MovingObstacle" class="py-name" href="#" onclick="return doclink('link-17', 'MovingObstacle', 'link-17');">MovingObstacle</a></tt> </tt>
<a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt id="link-18" class="py-name" targets="Module mover=mover-module.html"><a title="mover" class="py-name" href="#" onclick="return doclink('link-18', 'mover', 'link-18');">mover</a></tt> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-19" class="py-name" targets="Module clock=clock-module.html"><a title="clock" class="py-name" href="#" onclick="return doclink('link-19', 'clock', 'link-19');">clock</a></tt> <tt class="py-keyword">import</tt> <tt id="link-20" class="py-name" targets="Class clock.Clock=clock.Clock-class.html"><a title="clock.Clock" class="py-name" href="#" onclick="return doclink('link-20', 'Clock', 'link-20');">Clock</a></tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-21" class="py-name" targets="Module hud=hud-module.html"><a title="hud" class="py-name" href="#" onclick="return doclink('link-21', 'hud', 'link-21');">hud</a></tt> <tt class="py-keyword">import</tt> <tt id="link-22" class="py-name" targets="Class hud.Hud=hud.Hud-class.html"><a title="hud.Hud" class="py-name" href="#" onclick="return doclink('link-22', 'Hud', 'link-22');">Hud</a></tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">psyco</tt> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-23" class="py-name" targets="Module profilehooks=profilehooks-module.html"><a title="profilehooks" class="py-name" href="#" onclick="return doclink('link-23', 'profilehooks', 'link-23');">profilehooks</a></tt> <tt class="py-keyword">import</tt> <tt id="link-24" class="py-name" targets="Function profilehooks.profile()=profilehooks-module.html#profile"><a title="profilehooks.profile" class="py-name" href="#" onclick="return doclink('link-24', 'profile', 'link-24');">profile</a></tt> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line"> </tt>
<a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line"><tt class="py-decorator">@</tt><tt class="py-decorator">profile</tt> </tt>
<a name="run"></a><div id="run-def"><a name="L24"></a><tt class="py-lineno"> 24</tt> <a class="py-toggle" href="#" id="run-toggle" onclick="return toggle('run');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="profiled_run-module.html#run">run</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="run-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="run-expanded"><a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line">  <tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">init</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line">  <tt class="py-name">random</tt><tt class="py-op">.</tt><tt class="py-name">seed</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line">   </tt>
<a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line">  <tt class="py-name">display_size</tt> <tt class="py-op">=</tt> <tt class="py-number">800</tt><tt class="py-op">,</tt> <tt class="py-number">600</tt> </tt>
<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line">  <tt class="py-name">viewport_size</tt> <tt class="py-op">=</tt> <tt class="py-name">display_size</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-number">500</tt> </tt>
<a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line">  <tt class="py-name">black</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line">  <tt class="py-name">red</tt> <tt class="py-op">=</tt> <tt class="py-number">255</tt><tt class="py-op">,</tt> <tt class="py-number">70</tt><tt class="py-op">,</tt> <tt class="py-number">70</tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line">  <tt class="py-name">green</tt> <tt class="py-op">=</tt> <tt class="py-number">70</tt><tt class="py-op">,</tt> <tt class="py-number">255</tt><tt class="py-op">,</tt> <tt class="py-number">70</tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line">  <tt class="py-name">blue</tt> <tt class="py-op">=</tt> <tt class="py-number">70</tt><tt class="py-op">,</tt> <tt class="py-number">70</tt><tt class="py-op">,</tt> <tt class="py-number">255</tt> </tt>
<a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line">  <tt class="py-name">white</tt> <tt class="py-op">=</tt> <tt class="py-number">255</tt><tt class="py-op">,</tt> <tt class="py-number">255</tt><tt class="py-op">,</tt> <tt class="py-number">255</tt> </tt>
<a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line"> </tt>
<a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line">  <tt class="py-name">l_green</tt> <tt class="py-op">=</tt> <tt class="py-number">50</tt><tt class="py-op">,</tt> <tt class="py-number">255</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line"> </tt>
<a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line">  <tt class="py-name">screen</tt> <tt class="py-op">=</tt> <tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">display</tt><tt class="py-op">.</tt><tt class="py-name">set_mode</tt><tt class="py-op">(</tt><tt class="py-name">display_size</tt><tt class="py-op">)</tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line">  <tt class="py-name">screen</tt><tt class="py-op">.</tt><tt id="link-25" class="py-name" targets="Method base.Overlay.fill()=base.Overlay-class.html#fill"><a title="base.Overlay.fill" class="py-name" href="#" onclick="return doclink('link-25', 'fill', 'link-25');">fill</a></tt><tt class="py-op">(</tt><tt class="py-name">black</tt><tt class="py-op">)</tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line"> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line">  <tt id="link-26" class="py-name"><a title="clock" class="py-name" href="#" onclick="return doclink('link-26', 'clock', 'link-19');">clock</a></tt> <tt class="py-op">=</tt> <tt id="link-27" class="py-name"><a title="clock.Clock" class="py-name" href="#" onclick="return doclink('link-27', 'Clock', 'link-20');">Clock</a></tt><tt class="py-op">(</tt><tt class="py-name">readonly</tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt><tt class="py-op">)</tt> </tt>
<a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line"> </tt>
<a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line">  <tt class="py-name">dbman</tt> <tt class="py-op">=</tt> <tt id="link-28" class="py-name"><a title="dbmanager.DBManager" class="py-name" href="#" onclick="return doclink('link-28', 'DBManager', 'link-1');">DBManager</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line">  <tt class="py-name">dbman</tt><tt class="py-op">.</tt><tt id="link-29" class="py-name" targets="Method dbmanager.DBManager.import_db()=dbmanager.DBManager-class.html#import_db"><a title="dbmanager.DBManager.import_db" class="py-name" href="#" onclick="return doclink('link-29', 'import_db', 'link-29');">import_db</a></tt><tt class="py-op">(</tt><tt class="py-string">'./db'</tt><tt class="py-op">)</tt> </tt>
<a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line"> </tt>
<a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line">  <tt class="py-name">gfxman</tt> <tt class="py-op">=</tt> <tt id="link-30" class="py-name"><a title="gfxmanager.GfxManager" class="py-name" href="#" onclick="return doclink('link-30', 'GfxManager', 'link-3');">GfxManager</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line">  <tt class="py-name">gfxman</tt><tt class="py-op">.</tt><tt id="link-31" class="py-name" targets="Method gfxmanager.GfxManager.import_gfx()=gfxmanager.GfxManager-class.html#import_gfx"><a title="gfxmanager.GfxManager.import_gfx" class="py-name" href="#" onclick="return doclink('link-31', 'import_gfx', 'link-31');">import_gfx</a></tt><tt class="py-op">(</tt><tt class="py-name">dbman</tt><tt class="py-op">.</tt><tt id="link-32" class="py-name" targets="Method dbmanager.DBManager.get()=dbmanager.DBManager-class.html#get,Method gfxmanager.GfxManager.get()=gfxmanager.GfxManager-class.html#get,Method groupmanager.GroupManager.get()=groupmanager.GroupManager-class.html#get,Method stagemanager.StageManager.get()=stagemanager.StageManager-class.html#get"><a title="dbmanager.DBManager.get
gfxmanager.GfxManager.get
groupmanager.GroupManager.get
stagemanager.StageManager.get" class="py-name" href="#" onclick="return doclink('link-32', 'get', 'link-32');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-string">'./gfx'</tt><tt class="py-op">)</tt> </tt>
<a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line"> </tt>
<a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line">  <tt id="link-33" class="py-name"><a title="stagemanager" class="py-name" href="#" onclick="return doclink('link-33', 'stagemanager', 'link-4');">stagemanager</a></tt> <tt class="py-op">=</tt> <tt id="link-34" class="py-name"><a title="stagemanager.StageManager" class="py-name" href="#" onclick="return doclink('link-34', 'StageManager', 'link-5');">StageManager</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line">  <tt id="link-35" class="py-name"><a title="stagemanager" class="py-name" href="#" onclick="return doclink('link-35', 'stagemanager', 'link-4');">stagemanager</a></tt><tt class="py-op">.</tt><tt id="link-36" class="py-name" targets="Method stagemanager.StageManager.import_stages()=stagemanager.StageManager-class.html#import_stages"><a title="stagemanager.StageManager.import_stages" class="py-name" href="#" onclick="return doclink('link-36', 'import_stages', 'link-36');">import_stages</a></tt><tt class="py-op">(</tt><tt class="py-string">'./stages'</tt><tt class="py-op">)</tt> </tt>
<a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line">  <tt class="py-name">stages</tt> <tt class="py-op">=</tt> <tt id="link-37" class="py-name"><a title="stagemanager" class="py-name" href="#" onclick="return doclink('link-37', 'stagemanager', 'link-4');">stagemanager</a></tt><tt class="py-op">.</tt><tt id="link-38" class="py-name"><a title="dbmanager.DBManager.get
gfxmanager.GfxManager.get
groupmanager.GroupManager.get
stagemanager.StageManager.get" class="py-name" href="#" onclick="return doclink('link-38', 'get', 'link-32');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line"> </tt>
<a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line">  <tt id="link-39" class="py-name"><a title="groupmanager" class="py-name" href="#" onclick="return doclink('link-39', 'groupmanager', 'link-6');">groupmanager</a></tt> <tt class="py-op">=</tt> <tt id="link-40" class="py-name"><a title="groupmanager.GroupManager" class="py-name" href="#" onclick="return doclink('link-40', 'GroupManager', 'link-7');">GroupManager</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line"> </tt>
<a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line">  <tt class="py-name">g_ship</tt> <tt class="py-op">=</tt> <tt id="link-41" class="py-name"><a title="groupmanager" class="py-name" href="#" onclick="return doclink('link-41', 'groupmanager', 'link-6');">groupmanager</a></tt><tt class="py-op">.</tt><tt id="link-42" class="py-name" targets="Method groupmanager.GroupManager.add()=groupmanager.GroupManager-class.html#add"><a title="groupmanager.GroupManager.add" class="py-name" href="#" onclick="return doclink('link-42', 'add', 'link-42');">add</a></tt><tt class="py-op">(</tt><tt class="py-string">'ship'</tt><tt class="py-op">)</tt> </tt>
<a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line">  <tt class="py-name">g_enemies</tt> <tt class="py-op">=</tt> <tt id="link-43" class="py-name"><a title="groupmanager" class="py-name" href="#" onclick="return doclink('link-43', 'groupmanager', 'link-6');">groupmanager</a></tt><tt class="py-op">.</tt><tt id="link-44" class="py-name"><a title="groupmanager.GroupManager.add" class="py-name" href="#" onclick="return doclink('link-44', 'add', 'link-42');">add</a></tt><tt class="py-op">(</tt><tt class="py-string">'enemies'</tt><tt class="py-op">)</tt> </tt>
<a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line">  <tt class="py-name">g_enemy_projectiles</tt> <tt class="py-op">=</tt> <tt id="link-45" class="py-name"><a title="groupmanager" class="py-name" href="#" onclick="return doclink('link-45', 'groupmanager', 'link-6');">groupmanager</a></tt><tt class="py-op">.</tt><tt id="link-46" class="py-name"><a title="groupmanager.GroupManager.add" class="py-name" href="#" onclick="return doclink('link-46', 'add', 'link-42');">add</a></tt><tt class="py-op">(</tt><tt class="py-string">'enemy_projectiles'</tt><tt class="py-op">)</tt> </tt>
<a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line">  <tt class="py-name">g_player_projectiles</tt> <tt class="py-op">=</tt> <tt id="link-47" class="py-name"><a title="groupmanager" class="py-name" href="#" onclick="return doclink('link-47', 'groupmanager', 'link-6');">groupmanager</a></tt><tt class="py-op">.</tt><tt id="link-48" class="py-name"><a title="groupmanager.GroupManager.add" class="py-name" href="#" onclick="return doclink('link-48', 'add', 'link-42');">add</a></tt><tt class="py-op">(</tt><tt class="py-string">'player_projectiles'</tt><tt class="py-op">)</tt> </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line">  <tt class="py-name">g_beams</tt> <tt class="py-op">=</tt> <tt id="link-49" class="py-name"><a title="groupmanager" class="py-name" href="#" onclick="return doclink('link-49', 'groupmanager', 'link-6');">groupmanager</a></tt><tt class="py-op">.</tt><tt id="link-50" class="py-name"><a title="groupmanager.GroupManager.add" class="py-name" href="#" onclick="return doclink('link-50', 'add', 'link-42');">add</a></tt><tt class="py-op">(</tt><tt class="py-string">'beams'</tt><tt class="py-op">)</tt> </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line">  <tt class="py-name">g_explosions</tt> <tt class="py-op">=</tt> <tt id="link-51" class="py-name"><a title="groupmanager" class="py-name" href="#" onclick="return doclink('link-51', 'groupmanager', 'link-6');">groupmanager</a></tt><tt class="py-op">.</tt><tt id="link-52" class="py-name"><a title="groupmanager.GroupManager.add" class="py-name" href="#" onclick="return doclink('link-52', 'add', 'link-42');">add</a></tt><tt class="py-op">(</tt><tt class="py-string">'explosions'</tt><tt class="py-op">)</tt> </tt>
<a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line">  <tt class="py-name">g_shields</tt> <tt class="py-op">=</tt> <tt id="link-53" class="py-name"><a title="groupmanager" class="py-name" href="#" onclick="return doclink('link-53', 'groupmanager', 'link-6');">groupmanager</a></tt><tt class="py-op">.</tt><tt id="link-54" class="py-name"><a title="groupmanager.GroupManager.add" class="py-name" href="#" onclick="return doclink('link-54', 'add', 'link-42');">add</a></tt><tt class="py-op">(</tt><tt class="py-string">'shields'</tt><tt class="py-op">)</tt> </tt>
<a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line"> </tt>
<a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line">  <tt id="link-55" class="py-name"><a title="hud" class="py-name" href="#" onclick="return doclink('link-55', 'hud', 'link-21');">hud</a></tt> <tt class="py-op">=</tt> <tt id="link-56" class="py-name"><a title="hud.Hud" class="py-name" href="#" onclick="return doclink('link-56', 'Hud', 'link-22');">Hud</a></tt><tt class="py-op">(</tt><tt class="py-name">viewport_size</tt><tt class="py-op">)</tt> </tt>
<a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line"> </tt>
<a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line">  <tt class="py-name">g_enemies</tt><tt class="py-op">.</tt><tt id="link-57" class="py-name"><a title="groupmanager.GroupManager.add" class="py-name" href="#" onclick="return doclink('link-57', 'add', 'link-42');">add</a></tt><tt class="py-op">(</tt><tt id="link-58" class="py-name"><a title="obstacle.Obstacle" class="py-name" href="#" onclick="return doclink('link-58', 'Obstacle', 'link-16');">Obstacle</a></tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-number">60</tt><tt class="py-op">,</tt> <tt class="py-number">30</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line">  <tt class="py-name">g_enemies</tt><tt class="py-op">.</tt><tt id="link-59" class="py-name"><a title="groupmanager.GroupManager.add" class="py-name" href="#" onclick="return doclink('link-59', 'add', 'link-42');">add</a></tt><tt class="py-op">(</tt><tt id="link-60" class="py-name"><a title="obstacle.MovingObstacle" class="py-name" href="#" onclick="return doclink('link-60', 'MovingObstacle', 'link-17');">MovingObstacle</a></tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-number">160</tt><tt class="py-op">,</tt> <tt class="py-number">80</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line"> </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line">  <tt class="py-comment">#ship = AdvancedPlayerShip((175, viewport_size[1] - 60), g_ship)</tt> </tt>
<a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line"><tt class="py-comment"></tt>  <tt class="py-comment">#hud.setup_connections(ship)</tt> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line"><tt class="py-comment"></tt>  <tt class="py-name">AdvancedPlayerShip</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-number">175</tt><tt class="py-op">,</tt> <tt class="py-name">viewport_size</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-op">-</tt> <tt class="py-number">60</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">g_ship</tt><tt class="py-op">)</tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line">  <tt id="link-61" class="py-name"><a title="hud" class="py-name" href="#" onclick="return doclink('link-61', 'hud', 'link-21');">hud</a></tt><tt class="py-op">.</tt><tt id="link-62" class="py-name" targets="Method hud.Hud.setup_connections()=hud.Hud-class.html#setup_connections"><a title="hud.Hud.setup_connections" class="py-name" href="#" onclick="return doclink('link-62', 'setup_connections', 'link-62');">setup_connections</a></tt><tt class="py-op">(</tt><tt class="py-name">g_ship</tt><tt class="py-op">.</tt><tt class="py-name">sprites</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line"> </tt>
<a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line">  <tt class="py-name">back</tt> <tt class="py-op">=</tt> <tt id="link-63" class="py-name"><a title="background.SpaceBackground" class="py-name" href="#" onclick="return doclink('link-63', 'SpaceBackground', 'link-13');">SpaceBackground</a></tt><tt class="py-op">(</tt><tt class="py-name">viewport_size</tt><tt class="py-op">)</tt> </tt>
<a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line">  <tt class="py-name">g_bimg</tt> <tt class="py-op">=</tt> <tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">sprite</tt><tt class="py-op">.</tt><tt class="py-name">Group</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line"> </tt>
<a name="L76"></a><tt class="py-lineno"> 76</tt>  <tt class="py-line">  <tt class="py-keyword">for</tt> <tt class="py-name">stage_name</tt> <tt class="py-keyword">in</tt> <tt class="py-name">stages</tt><tt class="py-op">:</tt> </tt>
<a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line">    <tt class="py-name">stage_clock</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line">    <tt class="py-keyword">while</tt> <tt class="py-name">True</tt><tt class="py-op">:</tt> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line">      <tt class="py-keyword">for</tt> <tt class="py-name">spawn_time</tt> <tt class="py-keyword">in</tt> <tt class="py-name">stages</tt><tt class="py-op">[</tt><tt class="py-name">stage_name</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-string">'spawn'</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">spawn_time</tt> <tt class="py-op">&lt;=</tt> <tt class="py-name">stage_clock</tt><tt class="py-op">:</tt> </tt>
<a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line">          <tt class="py-keyword">while</tt> <tt class="py-name">stages</tt><tt class="py-op">[</tt><tt class="py-name">stage_name</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-string">'spawn'</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">spawn_time</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line">            <tt class="py-name">spawn</tt> <tt class="py-op">=</tt> <tt class="py-name">stages</tt><tt class="py-op">[</tt><tt class="py-name">stage_name</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-string">'spawn'</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">spawn_time</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">pop</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line">            <tt class="py-name">pos</tt> <tt class="py-op">=</tt> <tt class="py-name">spawn</tt><tt class="py-op">[</tt><tt class="py-string">'x'</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">spawn</tt><tt class="py-op">[</tt><tt class="py-string">'y'</tt><tt class="py-op">]</tt> </tt>
<a name="L84"></a><tt class="py-lineno"> 84</tt>  <tt class="py-line"> </tt>
<a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line">            <tt class="py-name">object_cls</tt> <tt class="py-op">=</tt> <tt class="py-name">eval</tt><tt class="py-op">(</tt><tt class="py-name">spawn</tt><tt class="py-op">[</tt><tt class="py-string">'object_cls_name'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line">            <tt class="py-name">object</tt> <tt class="py-op">=</tt> <tt class="py-name">object_cls</tt><tt class="py-op">(</tt><tt class="py-name">pos</tt><tt class="py-op">)</tt> </tt>
<a name="L87"></a><tt class="py-lineno"> 87</tt>  <tt class="py-line"> </tt>
<a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">spawn</tt><tt class="py-op">[</tt><tt class="py-string">'mover_cls_name'</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line">              <tt class="py-name">mover_cls</tt> <tt class="py-op">=</tt> <tt class="py-name">eval</tt><tt class="py-op">(</tt><tt class="py-string">"mover.%s"</tt> <tt class="py-op">%</tt> <tt class="py-name">spawn</tt><tt class="py-op">[</tt><tt class="py-string">'mover_cls_name'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line">              <tt class="py-name">m</tt> <tt class="py-op">=</tt> <tt class="py-name">mover_cls</tt><tt class="py-op">(</tt><tt class="py-name">pos</tt><tt class="py-op">,</tt> <tt class="py-name">object</tt><tt class="py-op">.</tt><tt id="link-64" class="py-name" targets="Variable spaceship.AGSprite.max_speed=spaceship.AGSprite-class.html#max_speed"><a title="spaceship.AGSprite.max_speed" class="py-name" href="#" onclick="return doclink('link-64', 'max_speed', 'link-64');">max_speed</a></tt><tt class="py-op">,</tt> <tt class="py-name">spawn</tt><tt class="py-op">[</tt><tt class="py-string">'mover_params'</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line">              <tt class="py-name">object</tt><tt class="py-op">.</tt><tt id="link-65" class="py-name"><a title="mover" class="py-name" href="#" onclick="return doclink('link-65', 'mover', 'link-18');">mover</a></tt> <tt class="py-op">=</tt> <tt class="py-name">m</tt> </tt>
<a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line"> </tt>
<a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">g</tt> <tt class="py-keyword">in</tt> <tt class="py-name">spawn</tt><tt class="py-op">[</tt><tt class="py-string">'groups'</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line">              <tt class="py-keyword">if</tt> <tt class="py-name">g</tt> <tt class="py-op">==</tt> <tt class="py-string">'enemies'</tt><tt class="py-op">:</tt> </tt>
<a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line">                <tt class="py-name">g_enemies</tt><tt class="py-op">.</tt><tt id="link-66" class="py-name"><a title="groupmanager.GroupManager.add" class="py-name" href="#" onclick="return doclink('link-66', 'add', 'link-42');">add</a></tt><tt class="py-op">(</tt><tt class="py-name">object</tt><tt class="py-op">)</tt> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line">              <tt class="py-keyword">elif</tt> <tt class="py-name">g</tt> <tt class="py-op">==</tt> <tt class="py-string">'explosions'</tt><tt class="py-op">:</tt> </tt>
<a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line">                <tt class="py-name">g_explosions</tt><tt class="py-op">.</tt><tt id="link-67" class="py-name"><a title="groupmanager.GroupManager.add" class="py-name" href="#" onclick="return doclink('link-67', 'add', 'link-42');">add</a></tt><tt class="py-op">(</tt><tt class="py-name">object</tt><tt class="py-op">)</tt> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line">              <tt class="py-keyword">elif</tt> <tt class="py-name">g</tt> <tt class="py-op">==</tt> <tt class="py-string">'enemy_projectiles'</tt><tt class="py-op">:</tt> </tt>
<a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line">                <tt class="py-name">g_enemy_projectiles</tt><tt class="py-op">.</tt><tt id="link-68" class="py-name"><a title="groupmanager.GroupManager.add" class="py-name" href="#" onclick="return doclink('link-68', 'add', 'link-42');">add</a></tt><tt class="py-op">(</tt><tt class="py-name">object</tt><tt class="py-op">)</tt> </tt>
<a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line">              <tt class="py-keyword">elif</tt> <tt class="py-name">g</tt> <tt class="py-op">==</tt> <tt class="py-string">'player_projectiles'</tt><tt class="py-op">:</tt> </tt>
<a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line">                <tt class="py-name">g_player_projectiles</tt><tt class="py-op">.</tt><tt id="link-69" class="py-name"><a title="groupmanager.GroupManager.add" class="py-name" href="#" onclick="return doclink('link-69', 'add', 'link-42');">add</a></tt><tt class="py-op">(</tt><tt class="py-name">object</tt><tt class="py-op">)</tt> </tt>
<a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line"> </tt>
<a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line">      <tt class="py-comment"># time management</tt> </tt>
<a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line"><tt class="py-comment"></tt>      <tt id="link-70" class="py-name"><a title="clock" class="py-name" href="#" onclick="return doclink('link-70', 'clock', 'link-19');">clock</a></tt><tt class="py-op">.</tt><tt id="link-71" class="py-name" targets="Method clock.Clock.tick()=clock.Clock-class.html#tick"><a title="clock.Clock.tick" class="py-name" href="#" onclick="return doclink('link-71', 'tick', 'link-71');">tick</a></tt><tt class="py-op">(</tt><tt class="py-number">40</tt><tt class="py-op">)</tt> </tt>
<a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line">      <tt class="py-comment">#clock.tick( float(sys.argv[1]) )</tt> </tt>
<a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line"><tt class="py-comment"></tt>      <tt class="py-name">stage_clock</tt> <tt class="py-op">+=</tt> <tt id="link-72" class="py-name"><a title="clock" class="py-name" href="#" onclick="return doclink('link-72', 'clock', 'link-19');">clock</a></tt><tt class="py-op">.</tt><tt id="link-73" class="py-name" targets="Static Method clock.Clock.get_rawtime()=clock.Clock-class.html#get_rawtime"><a title="clock.Clock.get_rawtime" class="py-name" href="#" onclick="return doclink('link-73', 'get_rawtime', 'link-73');">get_rawtime</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line"> </tt>
<a name="L108"></a><tt class="py-lineno">108</tt>  <tt class="py-line">      <tt class="py-keyword">for</tt> <tt class="py-name">event</tt> <tt class="py-keyword">in</tt> <tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">event</tt><tt class="py-op">.</tt><tt id="link-74" class="py-name"><a title="dbmanager.DBManager.get
gfxmanager.GfxManager.get
groupmanager.GroupManager.get
stagemanager.StageManager.get" class="py-name" href="#" onclick="return doclink('link-74', 'get', 'link-32');">get</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt>   <tt class="py-name">event</tt><tt class="py-op">.</tt><tt class="py-name">type</tt> <tt class="py-op">==</tt> <tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">QUIT</tt><tt class="py-op">:</tt> <tt class="py-name">sys</tt><tt class="py-op">.</tt><tt class="py-name">exit</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">event</tt><tt class="py-op">.</tt><tt class="py-name">type</tt> <tt class="py-op">==</tt> <tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">KEYDOWN</tt><tt class="py-op">:</tt> </tt>
<a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line">          <tt class="py-keyword">if</tt>   <tt class="py-name">event</tt><tt class="py-op">.</tt><tt class="py-name">key</tt> <tt class="py-op">==</tt> <tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">K_q</tt><tt class="py-op">:</tt> <tt class="py-name">sys</tt><tt class="py-op">.</tt><tt class="py-name">exit</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line">          <tt class="py-comment">#elif event.key == pygame.K_s: ship.next_weapon()</tt> </tt>
<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line"><tt class="py-comment"></tt>          <tt class="py-comment">#elif event.key == pygame.K_a: ship.previous_weapon()</tt> </tt>
<a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line"><tt class="py-comment"></tt>          <tt class="py-comment">#elif event.key == pygame.K_x: ship.activate_shield(True)</tt> </tt>
<a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line"><tt class="py-comment"></tt>          <tt class="py-keyword">elif</tt> <tt class="py-name">event</tt><tt class="py-op">.</tt><tt class="py-name">key</tt> <tt class="py-op">==</tt> <tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">K_s</tt><tt class="py-op">:</tt> </tt>
<a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">g_ship</tt><tt class="py-op">.</tt><tt class="py-name">sprites</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line">              <tt class="py-name">g_ship</tt><tt class="py-op">.</tt><tt class="py-name">sprites</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-75" class="py-name" targets="Method spaceship.PlayerShip.next_weapon()=spaceship.PlayerShip-class.html#next_weapon"><a title="spaceship.PlayerShip.next_weapon" class="py-name" href="#" onclick="return doclink('link-75', 'next_weapon', 'link-75');">next_weapon</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line">          <tt class="py-keyword">elif</tt> <tt class="py-name">event</tt><tt class="py-op">.</tt><tt class="py-name">key</tt> <tt class="py-op">==</tt> <tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">K_a</tt><tt class="py-op">:</tt> </tt>
<a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">g_ship</tt><tt class="py-op">.</tt><tt class="py-name">sprites</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line">              <tt class="py-name">g_ship</tt><tt class="py-op">.</tt><tt class="py-name">sprites</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-76" class="py-name" targets="Method spaceship.PlayerShip.previous_weapon()=spaceship.PlayerShip-class.html#previous_weapon"><a title="spaceship.PlayerShip.previous_weapon" class="py-name" href="#" onclick="return doclink('link-76', 'previous_weapon', 'link-76');">previous_weapon</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line">          <tt class="py-keyword">elif</tt> <tt class="py-name">event</tt><tt class="py-op">.</tt><tt class="py-name">key</tt> <tt class="py-op">==</tt> <tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">K_x</tt><tt class="py-op">:</tt> </tt>
<a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">g_ship</tt><tt class="py-op">.</tt><tt class="py-name">sprites</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line">              <tt class="py-name">g_ship</tt><tt class="py-op">.</tt><tt class="py-name">sprites</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-77" class="py-name" targets="Method spaceship.PlayerShip.activate_shield()=spaceship.PlayerShip-class.html#activate_shield"><a title="spaceship.PlayerShip.activate_shield" class="py-name" href="#" onclick="return doclink('link-77', 'activate_shield', 'link-77');">activate_shield</a></tt><tt class="py-op">(</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
<a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">event</tt><tt class="py-op">.</tt><tt class="py-name">type</tt> <tt class="py-op">==</tt> <tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">KEYUP</tt><tt class="py-op">:</tt> </tt>
<a name="L125"></a><tt class="py-lineno">125</tt>  <tt class="py-line">          <tt class="py-comment">#if   event.key == pygame.K_UP: ship.fly_up(False)</tt> </tt>
<a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line"><tt class="py-comment"></tt>          <tt class="py-comment">#elif event.key == pygame.K_x: ship.activate_shield(False)</tt> </tt>
<a name="L127"></a><tt class="py-lineno">127</tt>  <tt class="py-line"><tt class="py-comment"></tt>          <tt class="py-keyword">if</tt>   <tt class="py-name">event</tt><tt class="py-op">.</tt><tt class="py-name">key</tt> <tt class="py-op">==</tt> <tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">K_UP</tt><tt class="py-op">:</tt> </tt>
<a name="L128"></a><tt class="py-lineno">128</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">g_ship</tt><tt class="py-op">.</tt><tt class="py-name">sprites</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line">              <tt class="py-name">g_ship</tt><tt class="py-op">.</tt><tt class="py-name">sprites</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-78" class="py-name" targets="Method spaceship.PlayerShip.fly_up()=spaceship.PlayerShip-class.html#fly_up"><a title="spaceship.PlayerShip.fly_up" class="py-name" href="#" onclick="return doclink('link-78', 'fly_up', 'link-78');">fly_up</a></tt><tt class="py-op">(</tt><tt class="py-name">False</tt><tt class="py-op">)</tt> </tt>
<a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line">          <tt class="py-keyword">elif</tt> <tt class="py-name">event</tt><tt class="py-op">.</tt><tt class="py-name">key</tt> <tt class="py-op">==</tt> <tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">K_x</tt><tt class="py-op">:</tt> </tt>
<a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">g_ship</tt><tt class="py-op">.</tt><tt class="py-name">sprites</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L132"></a><tt class="py-lineno">132</tt>  <tt class="py-line">              <tt class="py-name">g_ship</tt><tt class="py-op">.</tt><tt class="py-name">sprites</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-79" class="py-name"><a title="spaceship.PlayerShip.activate_shield" class="py-name" href="#" onclick="return doclink('link-79', 'activate_shield', 'link-77');">activate_shield</a></tt><tt class="py-op">(</tt><tt class="py-name">False</tt><tt class="py-op">)</tt> </tt>
<a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line">     </tt>
<a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line">      <tt class="py-name">pressed_keys</tt> <tt class="py-op">=</tt> <tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">key</tt><tt class="py-op">.</tt><tt class="py-name">get_pressed</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line">      <tt class="py-comment">#if pressed_keys[pygame.K_UP]: ship.fly_up(True)</tt> </tt>
<a name="L136"></a><tt class="py-lineno">136</tt>  <tt class="py-line"><tt class="py-comment"></tt>      <tt class="py-comment">#if pressed_keys[pygame.K_DOWN]: ship.fly_down(viewport_size[1])</tt> </tt>
<a name="L137"></a><tt class="py-lineno">137</tt>  <tt class="py-line"><tt class="py-comment"></tt>      <tt class="py-comment">#if pressed_keys[pygame.K_LEFT]: ship.fly_left()</tt> </tt>
<a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line"><tt class="py-comment"></tt>      <tt class="py-comment">#if pressed_keys[pygame.K_RIGHT]: ship.fly_right(viewport_size[0])</tt> </tt>
<a name="L139"></a><tt class="py-lineno">139</tt>  <tt class="py-line"><tt class="py-comment"></tt>      <tt class="py-comment">#if pressed_keys[pygame.K_z]: ship.shoot(g_bullets, g_explosions)</tt> </tt>
<a name="L140"></a><tt class="py-lineno">140</tt>  <tt class="py-line"><tt class="py-comment"></tt>      <tt class="py-keyword">if</tt> <tt class="py-name">pressed_keys</tt><tt class="py-op">[</tt><tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">K_UP</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">g_ship</tt><tt class="py-op">.</tt><tt class="py-name">sprites</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L142"></a><tt class="py-lineno">142</tt>  <tt class="py-line">          <tt class="py-name">g_ship</tt><tt class="py-op">.</tt><tt class="py-name">sprites</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-80" class="py-name"><a title="spaceship.PlayerShip.fly_up" class="py-name" href="#" onclick="return doclink('link-80', 'fly_up', 'link-78');">fly_up</a></tt><tt class="py-op">(</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
<a name="L143"></a><tt class="py-lineno">143</tt>  <tt class="py-line">      <tt class="py-keyword">if</tt> <tt class="py-name">pressed_keys</tt><tt class="py-op">[</tt><tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">K_DOWN</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L144"></a><tt class="py-lineno">144</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">g_ship</tt><tt class="py-op">.</tt><tt class="py-name">sprites</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L145"></a><tt class="py-lineno">145</tt>  <tt class="py-line">          <tt class="py-name">g_ship</tt><tt class="py-op">.</tt><tt class="py-name">sprites</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-81" class="py-name" targets="Method spaceship.PlayerShip.fly_down()=spaceship.PlayerShip-class.html#fly_down"><a title="spaceship.PlayerShip.fly_down" class="py-name" href="#" onclick="return doclink('link-81', 'fly_down', 'link-81');">fly_down</a></tt><tt class="py-op">(</tt><tt class="py-name">viewport_size</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L146"></a><tt class="py-lineno">146</tt>  <tt class="py-line">      <tt class="py-keyword">if</tt> <tt class="py-name">pressed_keys</tt><tt class="py-op">[</tt><tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">K_LEFT</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L147"></a><tt class="py-lineno">147</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">g_ship</tt><tt class="py-op">.</tt><tt class="py-name">sprites</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L148"></a><tt class="py-lineno">148</tt>  <tt class="py-line">          <tt class="py-name">g_ship</tt><tt class="py-op">.</tt><tt class="py-name">sprites</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-82" class="py-name" targets="Method spaceship.PlayerShip.fly_left()=spaceship.PlayerShip-class.html#fly_left"><a title="spaceship.PlayerShip.fly_left" class="py-name" href="#" onclick="return doclink('link-82', 'fly_left', 'link-82');">fly_left</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L149"></a><tt class="py-lineno">149</tt>  <tt class="py-line">      <tt class="py-keyword">if</tt> <tt class="py-name">pressed_keys</tt><tt class="py-op">[</tt><tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">K_RIGHT</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L150"></a><tt class="py-lineno">150</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">g_ship</tt><tt class="py-op">.</tt><tt class="py-name">sprites</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L151"></a><tt class="py-lineno">151</tt>  <tt class="py-line">          <tt class="py-name">g_ship</tt><tt class="py-op">.</tt><tt class="py-name">sprites</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-83" class="py-name" targets="Method spaceship.PlayerShip.fly_right()=spaceship.PlayerShip-class.html#fly_right"><a title="spaceship.PlayerShip.fly_right" class="py-name" href="#" onclick="return doclink('link-83', 'fly_right', 'link-83');">fly_right</a></tt><tt class="py-op">(</tt><tt class="py-name">viewport_size</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L152"></a><tt class="py-lineno">152</tt>  <tt class="py-line">      <tt class="py-keyword">if</tt> <tt class="py-name">pressed_keys</tt><tt class="py-op">[</tt><tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">K_z</tt><tt class="py-op">]</tt><tt class="py-op">:</tt>  </tt>
<a name="L153"></a><tt class="py-lineno">153</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">g_ship</tt><tt class="py-op">.</tt><tt class="py-name">sprites</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L154"></a><tt class="py-lineno">154</tt>  <tt class="py-line">          <tt class="py-name">g_ship</tt><tt class="py-op">.</tt><tt class="py-name">sprites</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt id="link-84" class="py-name" targets="Method spaceship.AmmoWeapon.shoot()=spaceship.AmmoWeapon-class.html#shoot,Method spaceship.EnemyShip.shoot()=spaceship.EnemyShip-class.html#shoot,Method spaceship.EnergyWeapon.shoot()=spaceship.EnergyWeapon-class.html#shoot,Method spaceship.InstantEnergyWeapon.shoot()=spaceship.InstantEnergyWeapon-class.html#shoot,Method spaceship.PlayerShip.shoot()=spaceship.PlayerShip-class.html#shoot,Method spaceship.ProjectileAmmoWeapon.shoot()=spaceship.ProjectileAmmoWeapon-class.html#shoot,Method spaceship.ProjectileEnergyWeapon.shoot()=spaceship.ProjectileEnergyWeapon-class.html#shoot,Method spaceship.Weapon.shoot()=spaceship.Weapon-class.html#shoot"><a title="spaceship.AmmoWeapon.shoot
spaceship.EnemyShip.shoot
spaceship.EnergyWeapon.shoot
spaceship.InstantEnergyWeapon.shoot
spaceship.PlayerShip.shoot
spaceship.ProjectileAmmoWeapon.shoot
spaceship.ProjectileEnergyWeapon.shoot
spaceship.Weapon.shoot" class="py-name" href="#" onclick="return doclink('link-84', 'shoot', 'link-84');">shoot</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L155"></a><tt class="py-lineno">155</tt>  <tt class="py-line"> </tt>
<a name="L156"></a><tt class="py-lineno">156</tt>  <tt class="py-line">      <tt class="py-name">screen</tt><tt class="py-op">.</tt><tt id="link-85" class="py-name"><a title="base.Overlay.fill" class="py-name" href="#" onclick="return doclink('link-85', 'fill', 'link-25');">fill</a></tt><tt class="py-op">(</tt><tt class="py-name">black</tt><tt class="py-op">)</tt> </tt>
<a name="L157"></a><tt class="py-lineno">157</tt>  <tt class="py-line">      <tt class="py-name">back</tt><tt class="py-op">.</tt><tt id="link-86" class="py-name" targets="Method background.BackgroundImage.update()=background.BackgroundImage-class.html#update,Method background.BackgroundObject.update()=background.BackgroundObject-class.html#update,Method background.SpaceBackground.update()=background.SpaceBackground-class.html#update,Method hud.Hud.update()=hud.Hud-class.html#update,Method mover.CircularMover.update()=mover.CircularMover-class.html#update,Method mover.LinearMover.update()=mover.LinearMover-class.html#update,Method mover.LinearPlayerTargetingMover.update()=mover.LinearPlayerTargetingMover-class.html#update,Method mover.Mover.update()=mover.Mover-class.html#update,Method mover.RandomMover.update()=mover.RandomMover-class.html#update,Method mover.SeekingMover.update()=mover.SeekingMover-class.html#update,Method mover.ZigZagMover.update()=mover.ZigZagMover-class.html#update,Method spaceship.AGSprite.update()=spaceship.AGSprite-class.html#update,Method spaceship.AutoShield.update()=spaceship.AutoShield-class.html#update,Method spaceship.Bonus.update()=spaceship.Bonus-class.html#update,Method spaceship.EnemyMine.update()=spaceship.EnemyMine-class.html#update,Method spaceship.EnemyShip.update()=spaceship.EnemyShip-class.html#update,Method spaceship.Explosion.update()=spaceship.Explosion-class.html#update,Method spaceship.InstantEnergyBeam.update()=spaceship.InstantEnergyBeam-class.html#update,Method spaceship.PlayerShip.update()=spaceship.PlayerShip-class.html#update,Method spaceship.Projectile.update()=spaceship.Projectile-class.html#update,Method spaceship.ScatteringProjectile.update()=spaceship.ScatteringProjectile-class.html#update,Method spaceship.Shield.update()=spaceship.Shield-class.html#update,Method spaceship.Ship.update()=spaceship.Ship-class.html#update,Method spaceship.SuperShield.update()=spaceship.SuperShield-class.html#update,Method spaceship.Weapon.update()=spaceship.Weapon-class.html#update,Method widgets.VerticalProgressBar.update()=widgets.VerticalProgressBar-class.html#update"><a title="background.BackgroundImage.update
background.BackgroundObject.update
background.SpaceBackground.update
hud.Hud.update
mover.CircularMover.update
mover.LinearMover.update
mover.LinearPlayerTargetingMover.update
mover.Mover.update
mover.RandomMover.update
mover.SeekingMover.update
mover.ZigZagMover.update
spaceship.AGSprite.update
spaceship.AutoShield.update
spaceship.Bonus.update
spaceship.EnemyMine.update
spaceship.EnemyShip.update
spaceship.Explosion.update
spaceship.InstantEnergyBeam.update
spaceship.PlayerShip.update
spaceship.Projectile.update
spaceship.ScatteringProjectile.update
spaceship.Shield.update
spaceship.Ship.update
spaceship.SuperShield.update
spaceship.Weapon.update
widgets.VerticalProgressBar.update" class="py-name" href="#" onclick="return doclink('link-86', 'update', 'link-86');">update</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L158"></a><tt class="py-lineno">158</tt>  <tt class="py-line">      <tt class="py-name">back</tt><tt class="py-op">.</tt><tt id="link-87" class="py-name" targets="Method background.SpaceBackground.draw()=background.SpaceBackground-class.html#draw,Method hud.Hud.draw()=hud.Hud-class.html#draw"><a title="background.SpaceBackground.draw
hud.Hud.draw" class="py-name" href="#" onclick="return doclink('link-87', 'draw', 'link-87');">draw</a></tt><tt class="py-op">(</tt><tt class="py-name">screen</tt><tt class="py-op">)</tt> </tt>
<a name="L159"></a><tt class="py-lineno">159</tt>  <tt class="py-line">      <tt class="py-name">g_bimg</tt><tt class="py-op">.</tt><tt id="link-88" class="py-name"><a title="background.BackgroundImage.update
background.BackgroundObject.update
background.SpaceBackground.update
hud.Hud.update
mover.CircularMover.update
mover.LinearMover.update
mover.LinearPlayerTargetingMover.update
mover.Mover.update
mover.RandomMover.update
mover.SeekingMover.update
mover.ZigZagMover.update
spaceship.AGSprite.update
spaceship.AutoShield.update
spaceship.Bonus.update
spaceship.EnemyMine.update
spaceship.EnemyShip.update
spaceship.Explosion.update
spaceship.InstantEnergyBeam.update
spaceship.PlayerShip.update
spaceship.Projectile.update
spaceship.ScatteringProjectile.update
spaceship.Shield.update
spaceship.Ship.update
spaceship.SuperShield.update
spaceship.Weapon.update
widgets.VerticalProgressBar.update" class="py-name" href="#" onclick="return doclink('link-88', 'update', 'link-86');">update</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L160"></a><tt class="py-lineno">160</tt>  <tt class="py-line">      <tt class="py-name">g_bimg</tt><tt class="py-op">.</tt><tt id="link-89" class="py-name"><a title="background.SpaceBackground.draw
hud.Hud.draw" class="py-name" href="#" onclick="return doclink('link-89', 'draw', 'link-87');">draw</a></tt><tt class="py-op">(</tt><tt class="py-name">screen</tt><tt class="py-op">)</tt> </tt>
<a name="L161"></a><tt class="py-lineno">161</tt>  <tt class="py-line"> </tt>
<a name="L162"></a><tt class="py-lineno">162</tt>  <tt class="py-line">      <tt class="py-comment"># temp</tt> </tt>
<a name="L163"></a><tt class="py-lineno">163</tt>  <tt class="py-line"><tt class="py-comment"></tt>      <tt class="py-comment">#if g_ship.sprites():</tt> </tt>
<a name="L164"></a><tt class="py-lineno">164</tt>  <tt class="py-line"><tt class="py-comment"></tt>      <tt class="py-comment">#  g_ship.sprites()[0].damage(1)</tt> </tt>
<a name="L165"></a><tt class="py-lineno">165</tt>  <tt class="py-line"><tt class="py-comment"></tt>      <tt class="py-comment">#</tt> </tt>
<a name="L166"></a><tt class="py-lineno">166</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="L167"></a><tt class="py-lineno">167</tt>  <tt class="py-line">      <tt class="py-name">g_enemies</tt><tt class="py-op">.</tt><tt id="link-90" class="py-name"><a title="background.BackgroundImage.update
background.BackgroundObject.update
background.SpaceBackground.update
hud.Hud.update
mover.CircularMover.update
mover.LinearMover.update
mover.LinearPlayerTargetingMover.update
mover.Mover.update
mover.RandomMover.update
mover.SeekingMover.update
mover.ZigZagMover.update
spaceship.AGSprite.update
spaceship.AutoShield.update
spaceship.Bonus.update
spaceship.EnemyMine.update
spaceship.EnemyShip.update
spaceship.Explosion.update
spaceship.InstantEnergyBeam.update
spaceship.PlayerShip.update
spaceship.Projectile.update
spaceship.ScatteringProjectile.update
spaceship.Shield.update
spaceship.Ship.update
spaceship.SuperShield.update
spaceship.Weapon.update
widgets.VerticalProgressBar.update" class="py-name" href="#" onclick="return doclink('link-90', 'update', 'link-86');">update</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L168"></a><tt class="py-lineno">168</tt>  <tt class="py-line">      <tt class="py-name">g_beams</tt><tt class="py-op">.</tt><tt id="link-91" class="py-name"><a title="background.BackgroundImage.update
background.BackgroundObject.update
background.SpaceBackground.update
hud.Hud.update
mover.CircularMover.update
mover.LinearMover.update
mover.LinearPlayerTargetingMover.update
mover.Mover.update
mover.RandomMover.update
mover.SeekingMover.update
mover.ZigZagMover.update
spaceship.AGSprite.update
spaceship.AutoShield.update
spaceship.Bonus.update
spaceship.EnemyMine.update
spaceship.EnemyShip.update
spaceship.Explosion.update
spaceship.InstantEnergyBeam.update
spaceship.PlayerShip.update
spaceship.Projectile.update
spaceship.ScatteringProjectile.update
spaceship.Shield.update
spaceship.Ship.update
spaceship.SuperShield.update
spaceship.Weapon.update
widgets.VerticalProgressBar.update" class="py-name" href="#" onclick="return doclink('link-91', 'update', 'link-86');">update</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L169"></a><tt class="py-lineno">169</tt>  <tt class="py-line">      <tt class="py-name">g_explosions</tt><tt class="py-op">.</tt><tt id="link-92" class="py-name"><a title="background.BackgroundImage.update
background.BackgroundObject.update
background.SpaceBackground.update
hud.Hud.update
mover.CircularMover.update
mover.LinearMover.update
mover.LinearPlayerTargetingMover.update
mover.Mover.update
mover.RandomMover.update
mover.SeekingMover.update
mover.ZigZagMover.update
spaceship.AGSprite.update
spaceship.AutoShield.update
spaceship.Bonus.update
spaceship.EnemyMine.update
spaceship.EnemyShip.update
spaceship.Explosion.update
spaceship.InstantEnergyBeam.update
spaceship.PlayerShip.update
spaceship.Projectile.update
spaceship.ScatteringProjectile.update
spaceship.Shield.update
spaceship.Ship.update
spaceship.SuperShield.update
spaceship.Weapon.update
widgets.VerticalProgressBar.update" class="py-name" href="#" onclick="return doclink('link-92', 'update', 'link-86');">update</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L170"></a><tt class="py-lineno">170</tt>  <tt class="py-line">      <tt class="py-name">g_ship</tt><tt class="py-op">.</tt><tt id="link-93" class="py-name"><a title="background.BackgroundImage.update
background.BackgroundObject.update
background.SpaceBackground.update
hud.Hud.update
mover.CircularMover.update
mover.LinearMover.update
mover.LinearPlayerTargetingMover.update
mover.Mover.update
mover.RandomMover.update
mover.SeekingMover.update
mover.ZigZagMover.update
spaceship.AGSprite.update
spaceship.AutoShield.update
spaceship.Bonus.update
spaceship.EnemyMine.update
spaceship.EnemyShip.update
spaceship.Explosion.update
spaceship.InstantEnergyBeam.update
spaceship.PlayerShip.update
spaceship.Projectile.update
spaceship.ScatteringProjectile.update
spaceship.Shield.update
spaceship.Ship.update
spaceship.SuperShield.update
spaceship.Weapon.update
widgets.VerticalProgressBar.update" class="py-name" href="#" onclick="return doclink('link-93', 'update', 'link-86');">update</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L171"></a><tt class="py-lineno">171</tt>  <tt class="py-line">      <tt class="py-name">g_enemy_projectiles</tt><tt class="py-op">.</tt><tt id="link-94" class="py-name"><a title="background.BackgroundImage.update
background.BackgroundObject.update
background.SpaceBackground.update
hud.Hud.update
mover.CircularMover.update
mover.LinearMover.update
mover.LinearPlayerTargetingMover.update
mover.Mover.update
mover.RandomMover.update
mover.SeekingMover.update
mover.ZigZagMover.update
spaceship.AGSprite.update
spaceship.AutoShield.update
spaceship.Bonus.update
spaceship.EnemyMine.update
spaceship.EnemyShip.update
spaceship.Explosion.update
spaceship.InstantEnergyBeam.update
spaceship.PlayerShip.update
spaceship.Projectile.update
spaceship.ScatteringProjectile.update
spaceship.Shield.update
spaceship.Ship.update
spaceship.SuperShield.update
spaceship.Weapon.update
widgets.VerticalProgressBar.update" class="py-name" href="#" onclick="return doclink('link-94', 'update', 'link-86');">update</a></tt><tt class="py-op">(</tt><tt class="py-name">viewport_size</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L172"></a><tt class="py-lineno">172</tt>  <tt class="py-line">      <tt class="py-name">g_player_projectiles</tt><tt class="py-op">.</tt><tt id="link-95" class="py-name"><a title="background.BackgroundImage.update
background.BackgroundObject.update
background.SpaceBackground.update
hud.Hud.update
mover.CircularMover.update
mover.LinearMover.update
mover.LinearPlayerTargetingMover.update
mover.Mover.update
mover.RandomMover.update
mover.SeekingMover.update
mover.ZigZagMover.update
spaceship.AGSprite.update
spaceship.AutoShield.update
spaceship.Bonus.update
spaceship.EnemyMine.update
spaceship.EnemyShip.update
spaceship.Explosion.update
spaceship.InstantEnergyBeam.update
spaceship.PlayerShip.update
spaceship.Projectile.update
spaceship.ScatteringProjectile.update
spaceship.Shield.update
spaceship.Ship.update
spaceship.SuperShield.update
spaceship.Weapon.update
widgets.VerticalProgressBar.update" class="py-name" href="#" onclick="return doclink('link-95', 'update', 'link-86');">update</a></tt><tt class="py-op">(</tt><tt class="py-name">viewport_size</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L173"></a><tt class="py-lineno">173</tt>  <tt class="py-line">      <tt class="py-name">g_shields</tt><tt class="py-op">.</tt><tt id="link-96" class="py-name"><a title="background.BackgroundImage.update
background.BackgroundObject.update
background.SpaceBackground.update
hud.Hud.update
mover.CircularMover.update
mover.LinearMover.update
mover.LinearPlayerTargetingMover.update
mover.Mover.update
mover.RandomMover.update
mover.SeekingMover.update
mover.ZigZagMover.update
spaceship.AGSprite.update
spaceship.AutoShield.update
spaceship.Bonus.update
spaceship.EnemyMine.update
spaceship.EnemyShip.update
spaceship.Explosion.update
spaceship.InstantEnergyBeam.update
spaceship.PlayerShip.update
spaceship.Projectile.update
spaceship.ScatteringProjectile.update
spaceship.Shield.update
spaceship.Ship.update
spaceship.SuperShield.update
spaceship.Weapon.update
widgets.VerticalProgressBar.update" class="py-name" href="#" onclick="return doclink('link-96', 'update', 'link-86');">update</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L174"></a><tt class="py-lineno">174</tt>  <tt class="py-line">      <tt id="link-97" class="py-name"><a title="hud" class="py-name" href="#" onclick="return doclink('link-97', 'hud', 'link-21');">hud</a></tt><tt class="py-op">.</tt><tt id="link-98" class="py-name"><a title="background.BackgroundImage.update
background.BackgroundObject.update
background.SpaceBackground.update
hud.Hud.update
mover.CircularMover.update
mover.LinearMover.update
mover.LinearPlayerTargetingMover.update
mover.Mover.update
mover.RandomMover.update
mover.SeekingMover.update
mover.ZigZagMover.update
spaceship.AGSprite.update
spaceship.AutoShield.update
spaceship.Bonus.update
spaceship.EnemyMine.update
spaceship.EnemyShip.update
spaceship.Explosion.update
spaceship.InstantEnergyBeam.update
spaceship.PlayerShip.update
spaceship.Projectile.update
spaceship.ScatteringProjectile.update
spaceship.Shield.update
spaceship.Ship.update
spaceship.SuperShield.update
spaceship.Weapon.update
widgets.VerticalProgressBar.update" class="py-name" href="#" onclick="return doclink('link-98', 'update', 'link-86');">update</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L175"></a><tt class="py-lineno">175</tt>  <tt class="py-line"> </tt>
<a name="L176"></a><tt class="py-lineno">176</tt>  <tt class="py-line">      <tt class="py-name">g_enemies</tt><tt class="py-op">.</tt><tt id="link-99" class="py-name"><a title="background.SpaceBackground.draw
hud.Hud.draw" class="py-name" href="#" onclick="return doclink('link-99', 'draw', 'link-87');">draw</a></tt><tt class="py-op">(</tt><tt class="py-name">screen</tt><tt class="py-op">)</tt> </tt>
<a name="L177"></a><tt class="py-lineno">177</tt>  <tt class="py-line">      <tt class="py-name">g_ship</tt><tt class="py-op">.</tt><tt id="link-100" class="py-name"><a title="background.SpaceBackground.draw
hud.Hud.draw" class="py-name" href="#" onclick="return doclink('link-100', 'draw', 'link-87');">draw</a></tt><tt class="py-op">(</tt><tt class="py-name">screen</tt><tt class="py-op">)</tt> </tt>
<a name="L178"></a><tt class="py-lineno">178</tt>  <tt class="py-line">      <tt class="py-name">g_beams</tt><tt class="py-op">.</tt><tt id="link-101" class="py-name"><a title="background.SpaceBackground.draw
hud.Hud.draw" class="py-name" href="#" onclick="return doclink('link-101', 'draw', 'link-87');">draw</a></tt><tt class="py-op">(</tt><tt class="py-name">screen</tt><tt class="py-op">)</tt> </tt>
<a name="L179"></a><tt class="py-lineno">179</tt>  <tt class="py-line">      <tt class="py-name">g_enemy_projectiles</tt><tt class="py-op">.</tt><tt id="link-102" class="py-name"><a title="background.SpaceBackground.draw
hud.Hud.draw" class="py-name" href="#" onclick="return doclink('link-102', 'draw', 'link-87');">draw</a></tt><tt class="py-op">(</tt><tt class="py-name">screen</tt><tt class="py-op">)</tt> </tt>
<a name="L180"></a><tt class="py-lineno">180</tt>  <tt class="py-line">      <tt class="py-name">g_player_projectiles</tt><tt class="py-op">.</tt><tt id="link-103" class="py-name"><a title="background.SpaceBackground.draw
hud.Hud.draw" class="py-name" href="#" onclick="return doclink('link-103', 'draw', 'link-87');">draw</a></tt><tt class="py-op">(</tt><tt class="py-name">screen</tt><tt class="py-op">)</tt> </tt>
<a name="L181"></a><tt class="py-lineno">181</tt>  <tt class="py-line">      <tt class="py-name">g_shields</tt><tt class="py-op">.</tt><tt id="link-104" class="py-name"><a title="background.SpaceBackground.draw
hud.Hud.draw" class="py-name" href="#" onclick="return doclink('link-104', 'draw', 'link-87');">draw</a></tt><tt class="py-op">(</tt><tt class="py-name">screen</tt><tt class="py-op">)</tt> </tt>
<a name="L182"></a><tt class="py-lineno">182</tt>  <tt class="py-line">      <tt class="py-name">g_explosions</tt><tt class="py-op">.</tt><tt id="link-105" class="py-name"><a title="background.SpaceBackground.draw
hud.Hud.draw" class="py-name" href="#" onclick="return doclink('link-105', 'draw', 'link-87');">draw</a></tt><tt class="py-op">(</tt><tt class="py-name">screen</tt><tt class="py-op">)</tt> </tt>
<a name="L183"></a><tt class="py-lineno">183</tt>  <tt class="py-line">      <tt id="link-106" class="py-name"><a title="hud" class="py-name" href="#" onclick="return doclink('link-106', 'hud', 'link-21');">hud</a></tt><tt class="py-op">.</tt><tt id="link-107" class="py-name"><a title="background.SpaceBackground.draw
hud.Hud.draw" class="py-name" href="#" onclick="return doclink('link-107', 'draw', 'link-87');">draw</a></tt><tt class="py-op">(</tt><tt class="py-name">screen</tt><tt class="py-op">)</tt> </tt>
<a name="L184"></a><tt class="py-lineno">184</tt>  <tt class="py-line"> </tt>
<a name="L185"></a><tt class="py-lineno">185</tt>  <tt class="py-line">      <tt class="py-name">screen</tt><tt class="py-op">.</tt><tt id="link-108" class="py-name"><a title="base.Overlay.fill" class="py-name" href="#" onclick="return doclink('link-108', 'fill', 'link-25');">fill</a></tt><tt class="py-op">(</tt><tt class="py-name">red</tt><tt class="py-op">,</tt> </tt>
<a name="L186"></a><tt class="py-lineno">186</tt>  <tt class="py-line">                  <tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">Rect</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-name">viewport_size</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L187"></a><tt class="py-lineno">187</tt>  <tt class="py-line">                              <tt class="py-op">(</tt><tt class="py-name">display_size</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L188"></a><tt class="py-lineno">188</tt>  <tt class="py-line">                               <tt class="py-name">display_size</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-op">-</tt> <tt class="py-name">viewport_size</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L189"></a><tt class="py-lineno">189</tt>  <tt class="py-line">                 <tt class="py-op">)</tt> </tt>
<a name="L190"></a><tt class="py-lineno">190</tt>  <tt class="py-line">      <tt class="py-name">pygame</tt><tt class="py-op">.</tt><tt class="py-name">display</tt><tt class="py-op">.</tt><tt class="py-name">flip</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L191"></a><tt class="py-lineno">191</tt>  <tt class="py-line">      <tt class="py-comment">#print g_ship.sprites()</tt> </tt>
<a name="L192"></a><tt class="py-lineno">192</tt>  <tt class="py-line"><tt class="py-comment"></tt>      <tt class="py-comment">#if g_ship.sprites():</tt> </tt>
<a name="L193"></a><tt class="py-lineno">193</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#print sys.getrefcount(g_ship.sprites()[0])</tt> </tt>
<a name="L194"></a><tt class="py-lineno">194</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="L195"></a><tt class="py-lineno">195</tt>  <tt class="py-line"><tt class="py-keyword">if</tt> <tt class="py-name">__name__</tt> <tt class="py-op">==</tt> <tt class="py-string">'__main__'</tt><tt class="py-op">:</tt> </tt>
<a name="L196"></a><tt class="py-lineno">196</tt>  <tt class="py-line">  <tt id="link-109" class="py-name" targets="Static Method application.AGLevel.run()=application.AGLevel-class.html#run,Static Method application.AGMenu.run()=application.AGMenu-class.html#run,Function profiled_run.run()=profiled_run-module.html#run,Module run=run-module.html,Function run.run()=run-module.html#run"><a title="application.AGLevel.run
application.AGMenu.run
profiled_run.run
run
run.run" class="py-name" href="#" onclick="return doclink('link-109', 'run', 'link-109');">run</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L197"></a><tt class="py-lineno">197</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0beta1 on Thu Jul 31 15:50:42 2008
    </td>
    <td align="right" class="footer">
      <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie()
  // -->
</script>
  
</body>
</html>
